#ifndef QPIPELINEHOST_H
#define QPIPELINEHOST_H

#include "qwidgethost.h"

#include <QWidget>
#include <QTimer>

class OBJECTS_SHARED_EXPORT QPipelineWidth : public QWidget
{
    Q_OBJECT
    Q_PROPERTY(int line_width READ lineWidth WRITE setLineWidth)
    Q_PROPERTY(int speed READ speed WRITE setSpeed)
public:
    explicit QPipelineWidth(QWidget *parent = 0);

    int     lineWidth();
    void    setLineWidth(int lineWidth);

    int     speed();
    void    setSpeed(int speed);
protected:
    void    paintEvent(QPaintEvent *);
signals:

protected slots:
    void    timer();
protected:
    int     m_line_width;
    qreal   m_point;
    QTimer  *m_timer;
    int     m_speed;
};

class QPipelineHost : public QWidgetHost
{
    Q_OBJECT
public:
    Q_INVOKABLE QPipelineHost(QAbstractHost *parent = 0);

    static QString get_show_name();
    static QString get_show_icon();
    static QString get_show_group();

public slots:
    int     lineWidth();
    void    setLineWidth(int lineWidth);
protected:
    void    init_property();
protected:
    void    create_object();
};

#endif // QPIPELINEHOST_H
